package demo.linkedlist;

import java.util.LinkedList;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-22
 */
public class Main {
    public static void main(String[] args) {
        Node a1 = new Node(1);
        Node a2 = new Node(2);
        Node a3 = new Node(3);

        a1.next = a2;
        a2.next = a3;

        a3.prev = a2;
        a2.prev = a1;

        Node first = a1;
        Node last = a3;

        Node pcur = first;
        while (pcur != null) {
            System.out.println(pcur);
            pcur = pcur.next;
        }
        System.out.println("______________");
        pcur = last;
        while (pcur != null) {
            System.out.println(pcur);
            pcur = pcur.prev;
        }

        LinkedList list = new LinkedList();
        list.add(1);
        list.add(2);
        System.out.println();


    }
}
